<script lang="ts" setup>
import { usePermission } from "@/hooks/usePermission";
import { computed } from "vue";

const { hasPermission } = usePermission();

interface Prop {
  permission: string | string[];
}

const props = withDefaults(defineProps<Prop>(), {
  permission: "",
});

const isShow = computed(() => hasPermission(props.permission));
</script>

<template>
  <div v-if="isShow">
    <slot></slot>
  </div>
</template>

<style lang="less" scoped></style>
